
<template>
  <div class="table100">
    <div v-if="enterpriselist.length>0">
      <el-table
        :data="enterpriselist"
        stripe
        style="width: 100%"
        height="600"
        border
        :header-cell-style="styleObj"
        :row-class-name="tableRowClassName"
      >
        <el-table-column type="index" label="序号" width="80">
        </el-table-column>
        <el-table-column prop="name" label="楼宇名称" width="550">
          <template  slot-scope="scope">
            <div class="zaiy" @click="jumpLYDetail(scope.row)">
              {{scope.row.name}}
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="comCount" label="在营企业"  > </el-table-column>
        <!-- <el-table-column prop="comOpen" label="近3月新增"  > </el-table-column>
        <el-table-column prop="comClose" label="近3月关闭"> </el-table-column>
        <el-table-column prop="capitalNum" label="注册资本"> </el-table-column>
        <el-table-column prop="insuranceAmount" label="参保人员"> </el-table-column>
          -->
      </el-table>
    </div>
    <div class="block" v-if="enterpriselist.length>0">
      <el-pagination
        align="right"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[1, 5, 10, 20]"
        :page-size="pageSize"
        layout="  prev, pager, next "
        :total="total"
      >
      </el-pagination>
    </div>
    <div class="m20" v-else>
      <div class="nodata">
        <img :src="nodata" alt="" srcset="">
      </div>
    </div>
  </div>
</template>

<script>

// import vHeight from "@/utils/vHeight/vHeight"
export default {
  name: "tableComponents",
  props:['enterpriselist','total','loadingLY'],

  data() {
    return {
      nodata: require("@/assets/map/nodata.png"),

      currentPage: 1, // 当前页码
      pageSize: 5, // 每页的数据条数
      styleObj: {
        color: "#000",
        background: "#F4F8FC",
        fontSize: "16px",
        fontFamily: "PingFangSC-Medium",
        fontWeight: 500
      },
    };
  },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.currentPage = 1;
      this.pageSize = val;
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.currentPage = val;
      this.$emit("setPageNum",val)
    },
    tableRowClassName({ row, rowIndex }) {
      console.log(rowIndex, 'rowIndex');
      if (rowIndex % 2 == 0) {
        return 'even-row';
      } else {
        return 'odd-row';
      }
    },
    jumpLYDetail(item){
         this.$router.push({
        path: '/bus-neighbors',
        query: {
          id: item.id,
          name: item.name,
          type: item.type,
          address: item.address,
          phone: item.phone,
          email: item.email,
          website: item.website,
          remark: item.remark,
          createTime: item.createTime,
    }
  })
    }
  },
};
</script>
<style scoped lang="scss">
.table100 {
  display: flex;
  width: 100%;
  flex-direction: column;
  position: relative;
}
.block {
  margin-top: 10px;
}
.el-drawer__body {
  &::-webkit-scrollbar {
    width: 0;
  }
}
::v-deep .el-table .even-row td {
  background-color: #fff !important;
}

::v-deep .el-table .odd-row td {
  background-color: #f4f8fc !important;
}
.zaiy{
  font-family: Microsoft YaHei, Microsoft YaHei;
font-weight: 400;
font-size: 16px;
color: #0071DF;
}
.zxun{
  font-family: Microsoft YaHei, Microsoft YaHei;
font-weight: 400;
font-size: 16px;
color: #FF824B;
}
.nodata {
  padding-top: 20%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;


}
.nodata img {
  width: 350px;
  height: 350px;
    display: inline-block;
  }
</style>






